import { axios } from '@/utils/request'

const api = {
  mchGetOrderList: '/mch_admin/order/list',
  handleOrderCancel: '/mch_adminorder/apply-order-delete',
  handleOrderSend: '/mch_admin/order/send',
  handleOrderConfirm: '/mch_admin/order/confirm',
  handleOrderPrint: '/mch_admin/order/print-order',
  handleOrderClerk: '/mch_admin/order/clerk',
  setSellerComments: '/mch_admin/order/seller-comments',
  setOrderAddress: '/mch_admin/order/set-order-address',
  getRefundList: '/mch_admin/order/refund',
  orderRefund: '/mch_admin/order/refund-handle',
  commentList: '/mch_admin/order/comment-list',
  commentReply: '/mch_admin/order/comment-reply',
  commentHide: '/mch_admin/order/comment-hide',
  commentDelete: '/mch_admin/order/comment-delete',
  addComment: '/mch_admin/order/comment-edit',
  edit: '/mch_admin/order/edit'
}

export default api

export function mchGetOrderList (parameter) {
  return axios({
    url: api.mchGetOrderList,
    method: 'get',
    params: parameter
  })
}

export function orderCancel (parameter) {
  return axios({
    url: api.handleOrderCancel,
    method: 'post',
    data: parameter
  })
}

export function orderSend (parameter) {
  return axios({
    url: api.handleOrderSend,
    method: 'post',
    data: parameter
  })
}

export function orderConfirm (parameter) {
  return axios({
    url: api.handleOrderConfirm,
    method: 'post',
    data: parameter
  })
}

export function orderPrint (parameter) {
  return axios({
    url: api.handleOrderPrint,
    method: 'post',
    data: parameter
  })
}

export function orderClerk (parameter) {
  return axios({
    url: api.handleOrderClerk,
    method: 'post',
    data: parameter
  })
}

export function setComments (parameter) {
  return axios({
    url: api.setSellerComments,
    method: 'get',
    params: parameter
  })
}

export function setAddress (parameter) {
  return axios({
    url: api.setOrderAddress,
    method: 'post',
    data: parameter
  })
}

export function refundList (parameter) {
  return axios({
    url: api.getRefundList,
    method: 'get',
    params: parameter
  })
}

export function refundOrder (parameter) {
  return axios({
    url: api.orderRefund,
    method: 'post',
    data: parameter
  })
}

export function getComment (parameter) {
  return axios({
    url: api.commentList,
    method: 'get',
    params: parameter
  })
}

export function handleCommentReply (parameter) {
  return axios({
    url: api.commentReply,
    method: 'post',
    data: parameter
  })
}

export function handleCommentHide (parameter) {
  return axios({
    url: api.commentHide,
    method: 'post',
    data: parameter
  })
}

export function handleCommentDelete (parameter) {
  return axios({
    url: api.commentDelete,
    method: 'post',
    data: parameter
  })
}

export function handleEditComment (parameter) {
  return axios({
    url: api.addComment,
    method: 'post',
    data: parameter
  })
}

export function orderEdit (parameter) {
  return axios({
    url: api.edit,
    method: 'get',
    params: parameter
  })
}